package com.itheima03;

public class ConverterDemo {
    public static void main(String[] args) {
        useConverter(new Converter() {
            @Override
            public int converter(String s) {
                return Integer.parseInt(s);
            }
        });

        useConverter(s -> Integer.parseInt(s));

        // 引用类方法
        useConverter(Integer::parseInt);
    }

    public static void useConverter(Converter c) {
        int converter = c.converter("100");
        System.out.println(converter);
    }
}
